import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

export default function createRouter() {
  return new VueRouter({
    mode: "history",
    routes: [
      {
        path: "/",
        name: "home",
        components: require("../views/Home.vue"), // () => import("../views/Home.vue"),
      },
      {
        path: "/about",
        name: "about",
        component: () =>
          import(/* webpackChunkName:'about' */ "../views/About.vue"),
      },
      {
        path: "/item/:id",
        name: "item",
        component: () => import("../views/Item.vue"),
      },
    ],
  });
}
